package net.colah.k1.core;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.openkoala.koala.commons.domain.KoalaAbstractEntity;

/**
 * Created by sinclair on 4/27/14.
 */
@Entity
@Table(name = "BO_ITEM")
public class Item extends KoalaAbstractEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6110633019948419720L;

	private Order order;

	private Inventory inventory;

	private BigDecimal listPrice;
	private Integer amount;
	private BigDecimal totalPrice;

	private String meno;

	@ManyToOne
	@JoinColumn(name = "ORDER_ID")
	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	@OneToOne
	@JoinColumn(name = "INVENTORY_ID")
	public Inventory getInventory() {
		return inventory;
	}

	public void setInventory(Inventory inventory) {
		this.inventory = inventory;
	}

	@Column(name = "LIST_PRICE", precision = 2)
	public BigDecimal getListPrice() {
		return listPrice;
	}

	public void setListPrice(BigDecimal listPrice) {
		this.listPrice = listPrice;
	}

	@Column(name = "AMOUNT")
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@Column(name = "TOTAL_PRICE", precision = 2)
	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	@Column(name="MENO", length=128)
	public String getMeno() {
		return meno;
	}

	public void setMeno(String meno) {
		this.meno = meno;
	}

	@Override
	public String[] businessKeys() {
		return new String[0];
	}
}
